package day19.feifei;


class TestPeopleThreaad{
    public static void main(String[] args) {
        CountrtThread countrtThread= new CountrtThread("中国");
        PeopleThread peopleThread=new PeopleThread("李政");
        countrtThread.setDaemon(true);
        countrtThread.start();
        peopleThread.start();
    }
}
class CountrtThread extends Thread{
    public CountrtThread(String name) {
        super(name);
    }

    @Override
    public void run(){
        while (true){
            try {
                sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(this.getName()+"国家保护着你");
        }
    }
}
public class PeopleThread extends Thread {
    public PeopleThread(String name) {
        super(name);
    }

    @Override
    public void run(){
        for (int i = 1; i <= 100; i++) {
            try {
                sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(this.getName()+"我活着，这是第"+i+"天");
        }
        System.out.println(this.getName()+"我over了");
    }
}